import Doc from '~/components/layout/docs'
import Limits from '~/components/limits'
import Note from '~/components/text/note'

export const meta = {
  title: 'Limits',
  description:
    'A list of limits and limitations that apply on the ZEIT Now platform.',
  editUrl: 'pages/docs/v2/platform/limits.mdx',
  lastEdited: '2020-02-13T17:52:10.000Z'
}

This page outlines all relevant limits and limitations present when using the ZEIT Now platform.

## Plans

This section highlights two areas relating to pricing plans, **Usage Allowances**, and **Plan Limits**.

### Usage Allowances

**Usage Allowances** are the maximum limits provided by each pricing plan. They specify a limit for the amount of resources available for use under that plan before deployments are blocked (Free plan) or [additional costs](/pricing) are incurred.

<Note>
  Execution time is calculated in units of 100ms. For example, 36ms will be
  billed as 100ms and 286ms will be billed as 300ms.
</Note>

<br />

| Limit                  | Free | Pro | Business | Enterprise |
| ---------------------- | ---- | --- | -------- | ---------- |
| Bandwidth (GB)         | 20   | 100 | 1000     | Custom     |
| Build Time (Hours)     | 2    | 10  | 100      | Custom     |
| Execution Time (Hours) | 20   | 100 | 1,000    | Custom     |
| Team Seats             | 3    | 3   | 6        | Custom     |
| Concurrent Builds      | 1    | 3   | 6        | Custom     |

### Plan Limits

**Plan Limits** are limitations that apply to specific plans that **cannot** be increased, the only way to do so is to upgrade to a higher tier pricing plan.

| Limit                        | Free | Pro  | Business | Enterprise |
| ---------------------------- | ---- | ---- | -------- | ---------- |
| Deployments (per day)        | 100  | 3000 | 3000     | Custom     |
| Deployment History           | 10   | -    | -        | -          |
| Execution Duration (Seconds) | 10   | 60   | 600      | 900        |

## Logs

All log types - **Build Time**, **Edge Network**, and **Runtime** - have differing behavior when it comes to storing logs.

During the [Build Step](/docs/v2/platform/glossary#build-step), all logs are stored and **persisted**.

For [Edge Network requests](/docs/v2/network/regions-and-providers#automatic-edge-cdn), all logs are **not persisted**.

For [Serverless Functions](/docs/v2/serverless-functions/introduction/), only logs from failed requests are **persisted**.

All other logs are stored in memory only and are **not persisted** between page views. Each log output is **limited to 4kb**. For log outputs greater than 4kb per Serverless Function invocation, only the last 4kb will be retained.

## Environment Variables

The total size of [environment variables](/docs/v2/serverless-functions/env-and-secrets/) is **limited to 4kb**.

[Deployments](/docs/v2/platform/deployments) made with environment variables exceeding the 4kb limit will fail at the [build step](/docs/v2/build-step/).

## Domains

The maximum amount of domains that can be applied to a single project, either from the ZEIT Dashboard or by using the `alias` key in a `now.json` file is **50**.

It is not possible to add more than 50 domains to a project using the ZEIT Dashboard.

[Deployments](/docs/v2/platform/deployments) made with more than 50 `alias` in a `now.json` file will fail at the [build step](/docs/v2/build-step/).

## Files

The maximum number of files that can be uploaded when making a [deployment](/docs/v2/platform/deployments) is **10,000**.

Deployments made that contain more than 10,000 files will fail at the [build step](/docs/v2/build-step/).

## HTTP/2 Push

The ZEIT Now platform does not currently support HTTP/2 Push.

## WebSockets

[Serverless Functions](/docs/v2/serverless-functions/introduction) do not support WebSockets.

Instead of pushing data, you can intelligently fetch data on-demand. For example, the `zeit.co` dashboard delivers real-time updates using [SWR](https://swr.now.sh).

If you need persistent connections to push data to the client, consider using third party pub/sub services. See the [Pusher Channels Guide](/guides/deploying-pusher-channels-with-zeit-now) for an example.

## SMTP

For security reasons, the ZEIT Now platform blocks outgoing SMTP connections.

As a result of this, we recommend using a third-party service to enable email functionality for [deployments](/docs/v2/platform/deployments).

## Serverless Function Size

The maximum size for a [Serverless Function](/docs/v2/serverless-functions/introduction) is **50 MB**.

You can configure [functions](/docs/configuration#project/functions) with `includeFiles` and `excludeFiles` which may affect the function size, however the limit cannot be configured.

## Serverless Function Concurrency

The maximum number of concurrent executions for a [Serverless Function](/docs/v2/serverless-functions/introduction/) is `1000`.

If you require a limit above `1000`, you should [contact our enterprise department](mailto:sales@zeit.co) to discuss custom limits available on an enterprise plan.

## Serverless Function Regions

It is possible to deploy [Serverless Functions](/docs/v2/serverless-functions/introduction/) to multiple regions, however this featured is limited to [paid plans](/pricing).

When attempting to deploy Serverless Functions to multiple regions on the Free plan, the deployment will fail before entering the [build step](/docs/v2/build-step/).

## Streaming Responses

ZEIT Now does not support streaming responses from Serverless Functions due to an upstream limitation from AWS.

## Reserved Variables

The following environment variable names are [reserved](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#lambda-environment-variables) and therefore unavailable for use:

- `AWS_REGION`
- `AWS_DEFAULT_REGION`
- `AWS_ACCESS_KEY_ID`
- `AWS_SECRET_KEY`
- `AWS_SECRET_ACCESS_KEY`
- `AWS_EXECUTION_ENV`
- `AWS_LAMBDA_LOG_GROUP_NAME`
- `AWS_LAMBDA_LOG_STREAM_NAME`
- `AWS_LAMBDA_FUNCTION_NAME`
- `AWS_LAMBDA_FUNCTION_MEMORY_SIZE`
- `AWS_LAMBDA_FUNCTION_VERSION`
- `AWS_SESSION_TOKEN`
- `NOW_REGION`
- `TZ`
- `_HANDLER`
- `LAMBDA_TASK_ROOT`
- `LAMBDA_RUNTIME_DIR`

[Deployments](/docs/v2/platform/deployments) made that use any of the reserved variable names will fail at the [build step](/docs/v2/build-step/).

## Rate Limits

**Rate limits** are hard limits that apply to the platform when performing actions that require a response from an API.

The **rate limits** table consists of the following four columns:

- **Description** - A brief summary of the limit which, where relevant, will advise what type of plan it applies to.
- **Limit** - The amount of actions permitted within the amount of time (**Duration**) specified.
- **Duration** - The amount of time (seconds) in which you can perform the specified amount of actions. Once a rate limit is hit, it will be reset after the **Duration** has expired.
- **Scope** - Who the limit applies to, `owner` refers to the account owner, `user` refers to an individual user on a **Team** account.

## Examples

Below are three examples that provide further information on how the rate limits work.

### Domain Deletion

Taking the domains deletion rate limit as an example, you are allowed to delete up to `60` domains every `60` seconds (1 minute). Should you hit the rate limit, you will need to wait another minute before deleting another domain.

### Team Deletion

With the team deletion rate limit, you are able to delete up to `20` teams every `3600` seconds (1 hour). Should you hit the rate limit, you will need to wait another hour before deleting another team.

### Username Update

For the username update rate limit, you are able to change your username up to `6` times every `604800` seconds (1 week). Should you hit the rate limit, you will need to wait another week before changing your username again.

---

<Limits />

export default ({ children }) => <Doc meta={meta}>{children}</Doc>

export const config = {
  amp: 'hybrid'
}
